package org.colcon.web.client;

import java.util.List;
import java.util.Map;

import org.colcon.web.model.Ballot;
import org.colcon.web.model.Group;
import org.colcon.web.model.Item;
import org.colcon.web.model.User;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface ColConServiceAsync
{
	void execute(String cmd, AsyncCallback<String> callback);
	void get(String path, AsyncCallback<Item> callback);
	
	void getGroups(AsyncCallback<List<Group>> callback);
	void getGroup(String name, AsyncCallback<Group> callback);
	void addGroup(String name, String text, AsyncCallback<Boolean> callback);
	void addMember(String group, String user, AsyncCallback<Boolean> callback);
	
	void getUsers(AsyncCallback<List<User>> callback);
	void getUser(String name, AsyncCallback<User> callback);
	void addUser(String name, String email, String password, AsyncCallback<Boolean> callback);
	void authenticate(String name, String password, AsyncCallback<User> callback);
	
	void usePower(String title, String power, Map<String, String> params, AsyncCallback<Boolean> callback);
	void submitVote(String votePath, String userId, String voteValue, AsyncCallback<Ballot> callback);
	void submitProposal(String votePath, String userId, String voteValue, AsyncCallback<Ballot> callback);
}
